﻿using System;
using System.Collections.Generic;
using Mbs;
using Mbs.Windows;

namespace ElementMap.Module
{
    public partial class ElementMapView : SmartPartControl, IElementMapView
    {
        public ElementMapView()
        {
            InitializeComponent();
        }

        public override void InitializeResource()
        {
            btnShow.Text = StringParser.Parse("${res:ElementMap.Show}");
            btnDisable.Text = StringParser.Parse("${res:ElementMap.Disable}");

            btnEnable.Text = "ElementMap.Enabled".StringResource();
            btnHidden.Text = "ElementMap.Hide".StringResource();
            btnExit.Text = "Global.Exit".StringResource();
        }

        public override IEnumerator<IDisposable> Attach()
        {
            yield return CommandNames.ShowCustomer.Attach(btnShow, "Click");
            yield return CommandNames.DisableShowCustomer.Attach(btnDisable, "Click");
            yield return CommandNames.EnableShowCustomer.Attach(btnEnable, "Click");
            yield return CommandNames.HideShowCustomer.Attach(btnHidden, "Click");
            yield return CommandNames.Exit.Attach(btnExit, "Click");
        }
    }
}
